<!-- Load TensorFlow.js. This is required -->
<script
  type="text/javascript"
  src="https://unpkg.com/@tensorflow/tfjs"
></script>

<!-- Load the NSFWJS library from AWS -->
<script type="text/javascript" src="https://unpkg.com/nsfwjs"></script>

<!-- For testing: Load from local bundle `yarn scriptbundle && yarn minbundle` -->
<!-- <script src="../../dist/nsfwjs.min.js"></script> -->

<script>
  // const nsfwjs = require('nsfwjs')
  const img = new Image()
  img.crossOrigin = 'anonymous'
  // some image here
  img.src = 'https://i.imgur.com/Kwxetau.jpg'

  // Load the model.
  nsfwjs.load().then(model => {
    // Classify the image.
    model.classify(img).then(predictions => {
      console.log('Predictions', predictions)
    })
  })
</script>
<pre>Checkout console.log output for results!</pre>
